package May;

import java.util.Scanner;

public class Test06Addition {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个数字，我将计算出他们之前所有数字的和");
        int sum=sc.nextInt();
        int number=0;
        for (int i=1;i<=sum;i++){
            number=number+i;
        }
        System.out.println("最后输出的结果是："+number);
    }
}
